package com.zbf.service;

import com.zbf.dao.UserDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author: LCG
 * 作者: LCG
 * 日期: 2021/6/1  15:25
 * 描述:
 */
@Component
public class UserService {

    @Autowired
    private UserDao userDao;

    public Map<String,Object> getUserByUserName(String loginName){
        return userDao.getUserByUserName(loginName);
    }

    public Map<String,Object> getUserMenusByUserId(String userId){
        List<String> userMenusByUserId = userDao.getUserMenusByUserId(userId);
        Map<String,Object> map=new HashMap<>();
        for (String s : userMenusByUserId) {
            map.put(s,"");
        }

        Map<String,Object>  mmmp=new HashMap<>();
        mmmp.put("menusUrl1",map);
        mmmp.put("menusUrl2",userMenusByUserId);


        return mmmp;
    }

}
